<template>
	<view>
		<u-sticky bgColor="#fff">
			<!-- <view class="flexcenter ffffff padding_top1">
				<view class="all1" :class="yystatus==1?'checkall':''" @click="changeyystatus(1)">預約</view>
				<view class="all3" :class="yystatus==2?'checkall':''" @click="changeyystatus(2)">住宿</view>
			</view> -->
			<template v-if="yystatus==1">
				<u-tabs lineColor="#FFB800" lineWidth="15" scrollable :activeStyle="{
				             color: '#ff0000',
				             fontWeight: 'bold',
				             transform: 'scale(1.05)'
				         }" :inactiveStyle="{
				             color: '#666666',
				             transform: 'scale(1)'
				         }" :list="tabList" @change="tabChage" v-if="tabsFlag"></u-tabs>
			</template>
			<template v-if="yystatus==2">
				<u-tabs lineColor="#FFB800" lineWidth="15" scrollable :activeStyle="{
				             color: '#ff0000',
				             fontWeight: 'bold',
				             transform: 'scale(1.05)'
				         }" :inactiveStyle="{
				             color: '#666666',
				             transform: 'scale(1)'
				         }" :list="tabListzs" @change="tabChagezs" v-if="tabsFlag"></u-tabs>
			</template>
		</u-sticky>
		<view class="mainpadding2">
			<!-- 預約 -->
			<template v-if="yystatus==1">
				<view class="flexcenter" v-if="!list.data.length">
					<view class="placeholderimage" style="margin-top: 100rpx;"></view>
				</view>
				<view class="" v-for="ite in list.data" :key="ite.yuefenzu">
					<view class="bghuang margin_top flexbetween radius hei_text main_size">
						<view>{{ite.yuefenzu}}</view>
						<view>{{ite.total}}</view>
					</view>
					<view class="mainpadding_top ffffff radius" v-for="item in ite.data" :key="item.id"
						@click="jumpdetailyy(item.id)">
						<view class="flexbetween">
							<view class="titletext hong_text bold" v-if="item.call_no">
								<text style="font-size: 40rpx;color: #019891;margin-right: 10rpx;" class="bold"
									v-if="item.ordergood.order_type==3">時</text>
								排號：{{item.call_no}}
							</view>
							<view class="hong_text main_size" v-show="item.status==0">未到店</view>
							<view class="lv_text main_size" v-show="item.status==1">已到店</view>
							<view class="huang_text main_size" v-show="item.status==2 && item.desk!=-1">{{item.desk}}
							</view>
							<view class="hui_text main_size" v-show="item.status==88">用戶取消</view>
							<view class="lv_text main_size" v-show="item.status==99">已完成</view>
						</view>
						<view class="hei_text margin_top main_size bold">客戶名稱：{{item.username}}</view>
						<view class="flexleft margin_top">
							<view class="hui_text main_size bold">客戶電話：{{maskMiddle(item.phone)}}</view>
						</view>
						<view class="flexbetween margin_top" v-if="item.image">
							<view class="xiaohei main_size">支付憑證</view>
							<image class="listleftimg1 radius" :src="item.image_text" mode=""
								@click.stop="lbtpriview(0,[item.image_text])"></image>
						</view>
						<view class="margin_top2 xiaolan" v-if="item.fpinfo">
							<view>發票編號：{{item.fpinfo.invoice_number}}</view>
						</view>
						<view class="hui_text margin_top main_size bold" v-if="item.ordergood.order_type!=3">
							客戶人數：大人{{item.crnum}}人，老人{{item.oldnum}}人，兒童{{item.ernum}}人，共{{item.ernum+item.oldnum+item.crnum}}人
						</view>
						<view class="hui_text margin_top main_size bold" v-if="item.ordergood.order_type==3">
							客戶人數：<text v-for="(ite,index) in item.cdbjhsf_data_text" :key="index">
								<text v-if="ite.num!=0" class="margin_right1"><text
										class="huang_text">{{ite.num}}</text>/{{ite.name}}</text></text></view>
						<view class="huang_text margin_top main_size bold">預約時間：{{item.yuefenzu}} {{item.yuetime}}
						</view>
						<view class="lv_text margin_top main_size bold" v-show="item.status==99">
							完成時間：{{secondDate(item.updatetime,0,0)}}</view>
						<view class="hong_text margin_top main_size bold" v-show="item.status==88">
							取消時間：{{secondDate(item.updatetime,0,0)}}</view>
						<view class="flexbetween margin_top" v-if="item.ordergood.ordergoodslist.length">
							<view class="text_a color_ling">訂單編號：{{item.ordergood.order_sn}}</view>
							<view class="text_x color_red" v-if="item.call_no">#{{item.call_no}}
							</view>
						</view>
						<view class="xiaohui margin_top bold textright">
							共{{item.ordergood.total_num || 0}}件，合計：
							<text class="xiaohuang">${{item.ordergood.countmoney || 0}}</text>
							<text>，優惠${{item.ordergood.yh_money || 0}}，已付：${{item.ordergood.paymoney || 0}}，</text>
							<text class="xiaohong">未付：${{item.ordergood.zhuimoney || 0}}</text>
						</view>
						<view class="flexright margin_top">
							<view class="listbtnhuang" v-show="item.status==0" @click.stop="phone(item)">
								{{item.is_guo==1?"已撥號":"撥號"}}
							</view>
							<!-- #ifdef APP-PLUS -->
							<!-- <view class="listbtnhuang margin_left2" v-show="item.status==0||item.status==1">推送</view> -->
							<!-- #endif -->
							<!-- <view class="listbtnhuang margin_left2" v-show="item.status==0" @click.stop="skipOrder(item.id)">跳过
								</view> -->
							<view class="listbtnhuang margin_left2" v-show="item.status==0 || item.status==1"
								@click.stop="cancelOrder(item.id)">取消</view>
							<view class="listbtnhuang margin_left2" v-show="item.status==1 && !ishave_zt"
								@click.stop="seating(item.id,item.ernum+item.oldnum+item.crnum)">完成
							</view>
							<view class="listbtnhuang margin_left2" v-show="item.status==1 && ishave_zt"
								@click.stop="tongzhi(item.user_id)">通知
							</view>
							<view class="listbtnhuang margin_left2" v-show="item.status==1 && ishave_zt"
								@click.stop="seating(item.id,item.ernum+item.oldnum+item.crnum)">入座/服務
							</view>
							<view class="listbtnhuang margin_left2"
								v-show="item.status==2 && item.ordergood.order_type!=3" @click.stop="diancan(item)">點餐
							</view>
							<!-- 吃到飽點餐 -->
							<view class="listbtnhuang margin_left2"
								v-show="item.status==2 && item.ordergood.order_type==3"
								@click.stop="chidaobaodc(item.id,item.ordergood.cdbtc_id)">點餐
							</view>
							<view class="listbtnhuang margin_left2" v-show="item.status==2"
								@click.stop="xianjinsk(item)">
								收款</view>
						</view>
						<!-- <view v-if="item.ordergood.ordergoodslist.length">
							<view class="padding_top3 line_top margin_top">
								<view class="flexbetween">
									<view class="text_a color_ling">訂單編號：{{item.ordergood.order_sn}}</view>
									<view class="text_x color_red" v-if="item.call_no">#{{item.call_no}}
									</view>
								</view>
								<view class="flexleft margin_top" v-for="(ite,inde) in item.ordergood.ordergoodslist"
									:key="inde">
									<view class="goodsImg margin_right3">
										<image :src="ite.logoimage_text" mode=""></image>
									</view>
									<view class="flex1">
										<view class="text_a color_san">{{ite.goods_name}}</view>
										<view class="text_b color_six flexbetween margin_top1" v-if="ite.wei || ite.hei">
											<text>尺寸：{{ite.wei}}*{{ite.hei}}</text>
											<text>用量：{{ite.formulacount}}{{ite.size}}</text>
										</view>
										<view class="text_b color_six" v-show="ite.spunatname">規格：{{ite.spunatname}}</view>
										<view class="flexbetween margin_top1">
											<view class="price xiaohuang">${{ite.d_price}}&nbsp;&nbsp;&nbsp;x{{ite.num}}
											</view>
											<view class="text_six xiaohuang color_orange">${{ite.price}}</view>
										</view>
									</view>
								</view>
							</view>
						</view> -->
					</view>
				</view>
			</template>
			<!-- 住宿 -->
			<template v-if="yystatus==2">
				<view class="flexcenter" v-if="!zslist.length">
					<view class="placeholderimage" style="margin-top: 100rpx;"></view>
				</view>
				<view class="" v-for="currentzs in zslist" :key="currentzs.orderdate">
					<view class="bghuang margin_top flexbetween radius hei_text main_size">
						<view>{{currentzs.orderdate}}</view>
						<view>{{currentzs.total}}</view>
					</view>
					<view class="mainpadding margin_top ffffff radius" v-for="(item,index) in currentzs.data"
						:key="item.id" @click="jumpdetail('/pages/yuYueOrder/zhusuxq?id=',item.id)">
						<view class="flexbetween ">
							<view class=" xiaohei titletext  bold">{{item.order_no}}</view>
							<view class="xiaohong" v-if="item.order_status==10">待支付</view>
							<view class="xiaohuang" v-if="item.order_status==20">待入住</view>
							<view class="xiaolv" v-if="item.order_status==30">已入住</view>
							<view class="xiaohui" v-if="item.order_status==40">已完成</view>
							<view class="xiaohui" v-if="item.order_status==50">取消待審核</view>
							<view class="xiaohui" v-if="item.order_status==60">已取消</view>
						</view>
						<view class="flexleft margin_top">
							<image :src="item.shoptable.image_text" class="goodsImg margin_right3" mode=""></image>
							<view class="flexcolumnbet" style="width: 100%;height: 157rpx;">
								<view class="xiaohei titletext">{{item.shoptable.num}} <text style="font-size: 26rpx;"
										class="xiaolan margin_left2"
										v-show="houtel_type==2">{{item.house_name?item.house_name:""}}</text></view>
								<view class="flexleft">
									<view class="" v-for="(ite,itedex) in item.gg_content_text" :key="itedex">
										<text class="xiaohui" style="color: #00a0e9;" v-for="(it,itdex) in ite.content"
											:key="itdex">
											<text class="margin_right1" v-show="it.num!=0">{{it.name}}*{{it.num}}</text>
										</text>
									</view>
								</view>
								<view class="eshiliu bold" v-show="item.shoptable.des" style="color: #333;">{{item.shoptable.des}}</view>
								<view class="xiaohei main_size flexleft flex_wrap">
									<view class="margin_right1 guigek" v-for="(it,ind) in item.shoptable.fwss_text"
										:key="it">{{it}}</view>
								</view>
								<view class="flexbetween" style="width: 100%;">
									<view class="xiaohong main_size">${{item.pay_price}}</view>
									<view class="xiaohui main_size">{{item.days}}晚 *{{item.house_num}}閒</view>
								</view>
							</view>
						</view>
						<view class="text_a color_jiu margin_top1">入住時間：{{item.start_date_text}}</view>
						<view class="text_a color_jiu margin_top1">結束時間：<text
								class="huang_text text_a">{{item.end_date_text}}</text></view>
						<view class="flexbetween margin_top" v-if="item.paypz_image_text">
							<view class="xiaohei main_size">支付憑證</view>
							<image class="listleftimg1 radius" :src="item.paypz_image_text" mode=""
								@click.stop="lbtpriview(0,[item.paypz_image_text])"></image>
						</view>
						<view class="flexright xiaohong margin_top1"
							v-if="Number(item.house_num)!=item.ordergoods.length">
							尚未登入入住訊息{{Number(item.house_num)-item.ordergoods.length}}筆
						</view>
						<!-- order_status,10=待支付,20=待入住,30=已入住,40=已完成，60已取消 -->
						<view class="flexright margin_top">
							<view class="listbtnhuang margin_left2" v-show="item.order_status==10"
								@click.stop="qrshoukuan(item.id)">確認收款</view>
							<!-- 指定房間不需要選擇房間直接入住 -->
							<view class="listbtnhuang margin_left2"
								v-show="item.order_status==20 && houtel_type==1 && khrzisShow(item)"
								@click.stop="zhuli(30,item.id)">客戶入住</view>
							<!-- 不指定房間 -->
							<view class="listbtnhuang margin_left2"
								v-show="item.order_status==20 && houtel_type==2 && khrzisShow(item)"
								@click.stop="ruzhufj(item)">客戶入住</view>
							<view class="listbtnhuang margin_left2" v-show="item.order_status==50"
								@click.stop="zscancelOrder(item)">確定取消</view>
							<view class="listbtnhuang margin_left2" v-show="item.order_status==30"
								@click.stop="zhuli(40,item.id)">客戶離店</view>
						</view>
					</view>
				</view>

			</template>
		</view>
		<u-modal :show="showConfirm" showCancelButton confirmColor="#ffb800" @cancel="showConfirm=false"
			confirmText="確認" cancelText="取消" @confirm="orderConfirm">
			<view class="slot-content color_ling text_weight text">
				{{text}}
			</view>
		</u-modal>
		<u-modal :show="tuikuanModal" title="" confirmColor="#FF8505" :closeOnClickOverlay="true" confirmText="確認"
			cancelText="取消" @close="tuikuanModal=false" @confirm="tuikuanconfirm">
			<view class="slot-content flexcolumn mainpadding2">
				<view class="textcenter xiaohuang bold" style="font-size: 40rpx;">訂單總金額：${{currentAllprice}}</view>
				<view class="flexbetween margin_top5">
					<view class="hei_text main_size">退款金額:</view>
					<input type="number" placeholder="請輸入退款金額" class="textcenter xiaohuang bold"
						style="text-align: right;font-size: 40rpx;width: 60%;" v-model="tui_price">
				</view>
				<view class="flexbetween margin_top">
					<view class="hei_text main_size">退款密碼:</view>
					<input type="password" placeholder="請輸入退款密碼" v-model="paypassword" style="text-align: right;">
				</view>
			</view>
		</u-modal>
		<u-modal :show="rzshow" showCancelButton confirmText="確認" cancelText="取消" confirmColor="#f5a623" title="選擇房間入住"
			@cancel="rzshow=false" @confirm="rzConfirm">
			<view class="slot-content" style="width: 90%;">
				<scroll-view scroll-y="true" style="width: 100%;height: 300rpx;">
					<view class="flexbetween margin_top" v-for="(item,index) in fangjian_arr" :key="index"
						@click="checkhouse(item,fangjian_arr)" v-if="item.type==2">
						<view class="xiaohei titletext bold">{{item.name}}</view>
						<u-icon name="checkmark-circle-fill" color="#ffb800" v-if="item.ischeck" size="18"></u-icon>
						<u-icon name="checkmark-circle-fill" color="#999" v-if="!item.ischeck" size="18"></u-icon>
					</view>
				</scroll-view>
			</view>
		</u-modal>
	</view>
</template>

<script>
	export default {
		name: "yuyueorderzj",
		data() {
			return {
				rzshow: false,
				fangjian_arr: [],
				tui_price: "",
				paypassword: "",
				currentAllprice: "",
				currentAll: {},
				currentid: "",
				tuikuanModal: false,
				showConfirm: false,
				text: "",
				tabList: [{
					id: 0,
					name: '未到店',
					badge: {
						value: 0,
					}
				}, {
					id: 1,
					name: '已到店',
					badge: {
						value: 0,
					}
				}, {
					id: 2,
					name: '已分配',
					badge: {
						value: 0,
					}
				}, {
					id: 99,
					name: '已完成',
					badge: {
						value: 0,
					}
				}, ],
				// 10=待支付,20=待入住,30=已入住,40=已完成,50=取消审核中,60=已取消
				tabListzs: [{
					id: 10,
					name: '待支付',
					badge: {
						value: 0,
					}
				}, {
					id: 50,
					name: '取消审核中',
					badge: {
						value: 0,
					}
				}, {
					id: 20,
					name: '待入住',
					badge: {
						value: 0,
					}
				}, {
					id: 30,
					name: '已入住',
					badge: {
						value: 0,
					}
				}, {
					id: "40,60",
					name: '已完成',
					badge: {
						value: 0,
					}
				}, ],
				tabsId: 0, //默认全部
				tabsIdzs: 10,
				shop_id: uni.getStorageSync("shop_id"),
				page: 1,
				list: {
					data: []
				},
				list: {
					data: []
				},
				id: "", //操作的订單id
				orderType: 0, //0取消 1跳过
				ishave_zt: true, //是否有使用，
				tabsFlag: false,
				yystatus: 1, //1預約，2住宿
				zslist: [],
				houtel_type: 1,
				house_num: 0
			}
		},
		methods: {
			checkhouse(item, arr) {
				if (item.ischeck) {
					item.ischeck = false
					return false
				}
				let num = 0
				arr.forEach(current => {
					if (current.ischeck) {
						num = num + 1
					}
				})
				if (num >= Number(this.house_num)) {
					this.http.toast("只能選擇" + this.house_num + "個房間")
					return false
				}
				item.ischeck = true
			},
			rzConfirm() {
				let choose_house_ids = []
				this.fangjian_arr.forEach(item => {
					if (item.ischeck) {
						choose_house_ids.push(item.id)
					}
				})
				if (this.house_num != choose_house_ids.length) {
					this.http.toast("最少選擇" + this.house_num + "個房間")
					return false
				}
				this.rzshow = false
				this.http.request('/api/hotel/clUserOrder', 'GET', {
					id: this.id,
					choose_house_ids: choose_house_ids.join(),
					order_status: 30
				}).then(res => {
					uni.hideLoading()
					this.http.toast(res.msg)
					if (res.code == 1) {
						this.getList()
					}
				})
			},
			ruzhufj(item) {
				let arr = item.house
				arr.forEach(item => {
					this.$set(item, "ischeck", false)
				})
				this.fangjian_arr = arr
				this.id = item.id
				this.house_num = item.house_num
				this.rzshow = true
			},
			tongzhi(user_id) {
				uni.showLoading({
					mask: true,
					title: "請稍後"
				})
				this.http.requestuser('/api/ordermake/callUserrz', 'GET', {
					user_id,
				}).then(res => {
					uni.hideLoading()
					if (res.code == 1) {
						httpRequest.toast(res.msg)
					}
				})
			},
			qrshoukuan(id) {
				this.http.modal('提示', '是否確認收款', true, (resp) => {
					if (resp) {
						uni.showLoading({
							mask: true,
							title: "請稍後"
						})
						this.http.request('/api/hotel/sureGetPrice', 'GET', {
							id,
						}).then(res => {
							uni.hideLoading()
							this.http.toast(res.msg)
							if (res.code == 1) {
								this.getList()
							}
						})
					}
				})
			},
			zhuli(val, id) {
				this.http.modal('提示', '請再次確認', true, (resp) => {
					if (resp) {
						uni.showLoading({
							mask: true,
							title: "請稍後"
						})
						this.http.request('/api/hotel/clUserOrder', 'GET', {
							id,
							order_status: val
						}).then(res => {
							uni.hideLoading()
							this.http.toast(res.msg)
							if (res.code == 1) {
								this.getList()
							}
						})
					}
				})
			},
			zscancelOrder(item) {
				this.currentAllprice = item.pay_price
				this.currentAll = item
				this.currentid = item.id
				this.tuikuanModal = true
			},
			tuikuanconfirm() {
				if (this.tui_price == "") {
					this.http.toast("請輸入退款金額")
					return false
				}
				if (Number(this.currentAllprice) < Number(this.tui_price)) {
					this.http.toast("退款金額不能大於訂單合計金額")
					return false
				}
				if (this.paypassword == "") {
					this.http.toast("請輸入退款密碼")
					return false
				}
				this.tuikuanModal = false
				if (this.currentAll.paytype == 5) { //line pay线上退款
					this.http.request('/api/pay/LinePayRefound', 'POST', {
						id: this.currentid,
						paymoney: this.tui_price,
						paypassword: this.paypassword,
						shop_id: this.shop_id
					}).then(res => {
						this.currentid = ""
						this.tui_price = ""
						this.paypassword = ""
						this.http.toast(res.msg)
						if (res.code == 1) {
							this.getList()
						}
					})
				} else if (this.currentAll.paytype == 7) { //街口线下支付退款
					this.http.request('/api/pay/jkoPayScanRefound', 'POST', {
						id: this.currentid,
						paymoney: this.tui_price,
						paypassword: this.paypassword,
						shop_id: this.shop_id
					}).then(res => {
						this.currentid = ""
						this.tui_price = ""
						this.paypassword = ""
						this.http.toast(res.msg)
						if (res.code == 1) {
							this.getList()
						}
					})
				} else if (this.currentAll.paytype == 8) { //line pay线下退款
					this.http.request('/api/pay/LinePayScanRefound', 'POST', {
						id: this.currentid,
						paymoney: this.tui_price,
						paypassword: this.paypassword,
						shop_id: this.shop_id
					}).then(res => {
						this.currentid = ""
						this.tui_price = ""
						this.paypassword = ""
						this.http.toast(res.msg)
						if (res.code == 1) {
							this.getList()
						}
					})
				} else {
					this.http.request('/api/hotel/returnHotelOrder', 'POST', {
						id: this.currentid,
						return_price: this.tui_price,
						paypassword: this.paypassword
					}).then(res => {
						this.currentid = ""
						this.tui_price = ""
						this.paypassword = ""
						this.http.toast(res.msg)
						if (res.code == 1) {
							this.getList()
						}
					})
				}

			},
			changeyystatus(val) {
				this.yystatus = val
				this.getList()
			},
			componentInit() {
				console.log("預約訂單初始化成功");
				this.getList()
				this.getztList()
				this.tabsFlag = false
				this.tabsFlag = true
				this.houtel_type = uni.getStorageSync("houtel_type")
			},
			jumpdetail(url, id) {
				uni.navigateTo({
					url: url + id
				})
			},
			jumpdetailyy(id) {
				uni.navigateTo({
					url: "/pages/yuYueOrder/dingdanxq?id=" + id
				})
			},
			async getztList() { //使用列表
				let _this = this
				let res = await this.http.request('/api/shop/listtable', 'POST', {
					shop_id: uni.getStorageSync("shop_id"), //店鋪id
				})
				if (res.code == 1) {
					if (res.data.length == 0) {
						this.ishave_zt = false
					}
				}
			},
			getorderMsg() {
				let url = ""
				if (this.yystatus == 1) {
					url = "/api/Ordermake/orderData"
				} else {
					url = "/api/hotel/orderData"
				}
				this.http.request(url, 'POST', {
					shop_id: this.shop_id, //店鋪id
				}).then(res => {
					if (this.yystatus == 1) {
						this.tabList[0].badge.value = res.data.wdd_num
						this.tabList[1].badge.value = res.data.ydd_num
						this.tabList[2].badge.value = res.data.yfp_num
						this.tabList[4].badge.value = res.data.total_num
					} else {
						this.tabListzs[0].badge.value = res.data.dzf_num
						this.tabListzs[1].badge.value = res.data.qxshz_num
						this.tabListzs[2].badge.value = res.data.drz_num
						this.tabListzs[3].badge.value = res.data.yrz_num
						// this.tabListzs[4].badge.value = res.data.total_num
					}

				})

			},
			async getList(isPage, page) {
				this.getorderMsg()
				this.$emit("zjchange", "")
				let _this = this
				let data = {
					page: page || 1,
					limit: 12,
					shop_id: this.shop_id,
					status: this.tabsId
				}
				let url = "/api/Ordermake/listOrdermake"
				if (this.yystatus == 2) {
					data = {
						page: page || 1,
						limit: 12,
						shop_id: this.shop_id,
						order_status: this.tabsIdzs
					}
					url = "/api/hotel/orderIndex"
				}
				let res = await this.http.request(url, "POST", data)
				if (res.code == 1) {
					if (this.yystatus == 1) { //預約訂單有分頁住宿沒有
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							_this.list = res.data
							_this.list.data = resList.data;
						}
					} else {
						this.zslist = res.data
					}

				} else {
					this.http.toast(res.msg)
				}
			},
			onReachBottomZj() {
				if (this.yystatus == 1) { //預約訂單有分頁住宿沒有
					let _this = this;
					let list = _this.list;
					let page = _this.page;
					if (list.last_page <= page) {
						return false;
					}
					page++;
					_this.page = page;
					_this.getList(true, page);
				}

			},
			tabChage(e) {
				console.log(e);
				this.tabsId = e.id
				this.getList()
			},
			tabChagezs(e) {
				this.tabsIdzs = e.id
				this.getList()
			},
			phone(item) {
				let p = item.phone
				if (item.is_guo != 1) {
					this.makecall(item.id)
				}
				uni.makePhoneCall({
					phoneNumber: p.toString()
				}).catch((e) => {
					// console.log(e)  //用catch(e)来捕获錯误{makePhoneCall:fail cancel}
				})
			},
			makecall(id) {
				this.http.request("/api/ordermake/makecall", "POST", {
					id
				}).then(res => {
					this.getList()
				})
			},

			skipOrder(id) { //跳过
				this.id = id
				this.text = "您確定要跳過此訂單嗎？"
				this.orderType = 1
				this.showConfirm = true
			},
			cancelOrder(id) { //取消
				this.id = id
				this.text = "您確定要取消此訂單嗎？"
				this.orderType = 0
				this.showConfirm = true
			},
			async orderConfirm() { //確認 取消订單/刪除订單
				let url = "",
					text = "";
				if (this.orderType == 0) {
					url = "/api/Ordermake/endOrdermake"
					text = "取消成功"
				} else {
					url = "/api/Ordermake/guoOrdermake"
					text = "跳過成功"
				}
				let res = await this.http.request(url, 'POST', {
					id: this.id
				})
				if (res.code == 1) {
					this.http.toast(text)
					this.showConfirm = false
					this.getList()
				} else if (res.code == 0) {
					this.http.toast(res.msg)
				} else {
					this.http.toast('系統處理中，請稍後再試');
				}
			},
			seating(id, count) { //入座/服務
				if (this.ishave_zt == false) {
					this.http.request('/api/Ordermake/addOrdermake', 'POST', {
						ordermark_id: id, //订單id
						table_id: 0,
						order_type: 2,
					}).then(res => {
						if (res.code == 1) {
							this.getList()
						} else {
							this.http.toast(res.msg)
						}
					})
					return false
				}
				uni.navigateTo({
					url: `/pages/yuYueOrder/selectDesk?id=${id}&count=${count}`
				})
			},
			chidaobaodc(order_id, cdbtc_id) {
				uni.setStorageSync("order_make_id", order_id)
				uni.navigateTo({
					url: "/pages/yuYueOrder/zizhucan?cdbtc_id=" + cdbtc_id
				})
			},
			diancan(item) {
				uni.setStorageSync("order_goods_id", item.order_goods_id)
				uni.navigateTo({
					url: "/pages/callOutOrder/xuanzefw?orderly=1"
				})
			},
			xianjinsk(item) {
				uni.navigateTo({
					url: "/pages/yuYueOrder/yuyuesk?total_price=" + item.ordergood.zhuimoney + "&id=" + item.id
				})
			},
			jumpurl(url) {
				console.log(123);
				uni.navigateTo({
					url
				})
			}

		}
	}
</script>

<style lang="scss" scoped>
	.margin_right3 {
		margin-right: 30rpx;
	}

	.goodsImg {
		width: 157rpx;
		height: 157rpx;
		min-width: 157rpx;
		position: relative;

		image {
			width: 100%;
			height: 100%;
			border-radius: 14rpx;
		}

		.shipment {
			// width: 71rpx;
			// height: 30rpx;
			// line-height: 30rpx;
			padding: 4rpx;
			box-sizing: border-box;
			text-align: center;
			background: #13C463;
			border-radius: 14rpx 0rpx 14rpx 0rpx;
			font-size: 18rpx;
			font-family: PingFang SC-Medium, PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
			position: absolute;
			left: 0;
			top: 0;
		}
	}

	.listleftimg1 {
		width: 150rpx;
		min-width: 150rpx;
		height: 150rpx;
		position: relative;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.bghuang {
		background-color: #feb800;
		padding: 15rpx 30rpx;
	}

	::v-deep.u-tabs__wrapper__nav__item {
		flex: 1;
		white-space: nowrap;
	}

	.all1 {
		background: #fFF;
		border-radius: 11rpx 0rpx 0rpx 11rpx;
		font-size: 32rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FF8505;
		padding: 11rpx 38rpx;
		border: 2rpx solid #FF8505;
	}

	.all3 {
		background: #fFF;
		border-radius: 0rpx 11rpx 11rpx 0rpx;
		font-size: 32rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FF8505;
		padding: 11rpx 38rpx;
		border: 2rpx solid #FF8505;
	}

	.checkall {
		background-color: #FF8505 !important;
		color: #fff !important;
	}
</style>